package com.bree.erp.service;

import java.util.Collection;
import java.util.Date;
import java.util.List;

import com.bree.erp.entity.PoAdjustment;
import com.bree.erp.entity.PoItem;
import com.bree.erp.entity.PrefixSequence;
import com.bree.erp.entity.PurchaseOrder;
import com.bree.erp.entity.Returns;
import com.bree.erp.entity.Status;
import com.bree.erp.entity.User;
import com.bree.erp.entity.Warehouse;

public interface PurchaseOrderService extends Crud<PurchaseOrder, Long>{

	PurchaseOrder create(Long prId, Long supplierId, String userId);
	PurchaseOrder read(Long id);
	PurchaseOrder read(Long id, boolean refresh);
	PurchaseOrder read(Long prId, Long supplierId, Status status);
	PurchaseOrder update(Long poId, String warehouseId, String term, Date dueDate,
			List<PoItem> deletePoItems, List<PoAdjustment> deleteAdjusments,
			List<PoAdjustment> adjustments, Status status, String remarks, String userId);
	PurchaseOrder update(Long poId, Status status, String userId);
	void delete(Long id);
	Collection<PurchaseOrder> list(Status ... status);
	Collection<PurchaseOrder> list(String userId, Long projectId, Status s);
	
	void withdraw(Warehouse warehouse, Long projectId, String description, List<Returns> list, User loggedInUser);
	PrefixSequence updateSequence(Long id);

}
